* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'MaShanZheng';
    src: url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap');
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.container {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.score-board {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    justify-content: center;
}

.score-card {
    padding: 10px 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 120px;
}

.score-card.black {
    border-left: 4px solid #000;
}

.score-card.white {
    border-left: 4px solid #666;
}

#status {
    font-size: 1.2em;
    padding: 10px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

#restart {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

#restart:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.board {
    display: inline-block;
    padding: 40px;
    background: linear-gradient(45deg, #dcb35c, #d4a84c);
    border-radius: 8px;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('');
    opacity: 0.1;
}

.cell {
    width: 44px;
    height: 44px;
    position: relative;
    cursor: pointer;
    background-color: transparent;
}

.cell::before,
.cell::after {
    content: '';
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.cell::before {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.cell::after {
    top: 50%;
    left: 0;
    height: 2px;
    width: 100%;
    transform: translateY(-50%);
}

.piece {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.piece.show {
    transform: translate(-50%, -50%) scale(1);
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #666, #000);
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.4),
        inset -2px -2px 4px rgba(0, 0, 0, 0.4),
        inset 2px 2px 4px rgba(255, 255, 255, 0.1);
}

.piece.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    box-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.2),
        inset -2px -2px 4px rgba(0, 0, 0, 0.1),
        inset 2px 2px 4px rgba(255, 255, 255, 0.5);
}

/* 游戏模式控制样式 */
.game-mode {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mode-button {
    padding: 10px 20px;
    font-size: 1em;
    font-family: 'Ma Shan Zheng', cursive;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.mode-button:hover {
    background: linear-gradient(45deg, #3498db, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.ai-settings {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Ma Shan Zheng', cursive;
}

.ai-settings label {
    color: #2c3e50;
    font-size: 1.1em;
}

.ai-settings select {
    padding: 5px 10px;
    border: 2px solid #3498db;
    border-radius: 4px;
    background: white;
    color: #2c3e50;
    font-family: 'Ma Shan Zheng', cursive;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.ai-settings select:hover {
    border-color: #2980b9;
}

.ai-settings select:focus {
    border-color: #2c3e50;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* AI思考状态样式 */
.board.thinking {
    position: relative;
    pointer-events: none;
}

.board.thinking::before {
    content: '思考中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 30px;
    border-radius: 20px;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    z-index: 100;
    animation: thinking 1.5s infinite;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes thinking {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* 水墨风结算弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    transition: all 0.5s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: url('');
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    margin: auto;
    max-width: 500px;
    width: 90%;
    transform: translateY(-50px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 0 0 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal h2 {
    color: #000;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.modal p {
    color: #333;
    margin-bottom: 35px;
    font-size: 1.5em;
    font-family: 'Ma Shan Zheng', cursive;
    line-height: 1.6;
    position: relative;
}

.modal button.play-again {
    padding: 12px 40px;
    font-size: 1.2em;
    font-family: 'Ma Shan Zheng', cursive;
    background: linear-gradient(45deg, #2c3e50, #3498db);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal button.play-again:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 动画效果 */
@keyframes celebrate {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.winner-celebrate .piece {
    animation: celebrate 0.5s ease-in-out;
}

@keyframes inkSpread {
    0% { transform: scale(0); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

.modal.show::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0,0,0,0.1) 0%, transparent 70%);
    transform-origin: center;
    animation: inkSpread 1.5s ease-out forwards;
}